package com.mashang.bookkeepingbook.pojo.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.HashMap;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result {
    private Integer code;
    private String msg;
    private Object data;

    public Result(String msg, Integer code, Object data) {
        this.msg = msg;
        this.code = code;
        this.data = data;
    }
    public Result(String msg, Integer code) {
        this.msg = msg;
        this.code = code;
    }
    public static Result Success(Object data) {
        return new Result("成功", 200, data);
    }
    public static Result Success(HashMap<String, Object> bIllVoList) {
        return new Result("成功", 200, bIllVoList);
    }
    public static Result Fail(String msg) {
        return new Result(msg, 500, null);
    }

    public static Result success() {

        return new Result("成功", 200, null);
    }
}
